/*
 * threadlib.cpp
 *
 *  Created on: 05.03.2012
 *      Author: Caffeine
 */
#include "threadlib.h"

#ifdef POSIX_LIBLARY
bool thread_create(ThreadHeader*th,threadFunction fun,void*arg){
	pthread_create(th,0,fun,(void*)arg);
	return *th!=0;
}
#endif

#ifdef WINDOWS_PLATFORM
bool thread_create(ThreadHeader*th,threadFunction fun,void*arg){
	th->Header=::CreateThread(0,0,fun,(PVOID)arg,0,&th->Id);
	return th->Header!=0;
}
#endif
